<?php
print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>Steal My Admin</title>
		<link rel="stylesheet" href="/css/960.css" type="text/css" media="screen" charset="utf-8" />
		<link rel="stylesheet" href="/css/template.css" type="text/css" media="screen" charset="utf-8" />
		<link rel="stylesheet" href="/css/colour.css" type="text/css" media="screen" charset="utf-8" />
		<script src="/js/lib/jquery-1.10.2.js" type="text/javascript"></script>
		<!--[if IE]><![if gte IE 6]><![endif]-->
		<script src="/js/glow/1.7.0/core/core.js" type="text/javascript"></script>
		<script src="/js/glow/1.7.0/widgets/widgets.js" type="text/javascript"></script>
		<link href="/js/glow/1.7.0/widgets/widgets.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript">
			glow.ready(function(){
				new glow.widgets.Sortable(
					'#content .grid_5, #content .grid_6',
					{
						draggableOptions : {
							handle : 'h2'
						}
					}
				);
			});
		</script>
		<!--[if IE]><![endif]><![endif]-->
	</head>
	<body>

		<h1 id="head">Steal My Admin Template</h1>
		
		<ul id="navigation">
			<li><span class="active">Overview</span></li>
			<li><a href="#">News</a></li>
			<li><a href="#">Users</a></li>
		</ul>

			<div id="content" class="container_16 clearfix">

				<div class="grid_16">
					<div class="box">
						<h2>At a Glance</h2>
						<div class="utils">
							<a href="#">View More</a>
						</div>
						<table>
							<tbody>
EOF;

                            foreach($articles as $article) {

print <<<EOF

								<tr>
									<td>
									    <a target="_blank" href="/back/article/article_show.php?id=${article['aid']}">${article["title"]}</a>
									</td>
									<td>${article["create_time"]}</td>
								</tr>					
EOF;
                            }
print <<<EOF
							</tbody>
						</table>
					</div>
					<div class="box">
						<h2>Quick Post</h2>
						<div class="utils">
							<a href="#">Advanced</a>
						</div>
						<form action="/back/article/article_add.php" method="post" id="addArticleForm">
							<p>
								<label for="title">Title <small>Alpha-numeric characters only.</small> </label>
								<input type="text" name="title" />
							</p>
							<p>
								<label for="post">Post <small>Parsed by Markdown.</small> </label>
								<textarea name="content"></textarea>
							</p>
							<p>
								<input type="submit" value="post" />
							</p>
						</form>
					</div>
				</div>
				
			</div>
		<div id="foot">
			<div class="container_16 clearfix">
				<div class="grid_16">
					<a href="#">Contact Me</a>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="/js/manage/article/article.js"></script>
	</body>
</html>
EOF;
